import Vue from 'vue'
import VueRouter from 'vue-router'
import ShopCar from '@/components/tabbar/ShopCar.vue'
import Member from '@/components/tabbar/Member.vue'
import Goodslist from '@/components/goods/List.vue'
import Home from '@/components/Home.vue'
import Image from '@/components/photo/Image.vue'
import NewsList from '@/components/news/NewsList.vue'
import NewsDetail from '@/components/news/NewsDetail.vue'
import Search from '@/components/search/Search.vue'
import AddGoods from '@/components/goods/Add.vue'
import GoodsDetail from '@/components/goods/GoodsDetail.vue'
import ImgDetail from '@/components/photo/Info.vue'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/home' },
  { path: '/home', component: Home },
  { path: '/shopcar', component: ShopCar },
  { path: '/member', component: Member },
  { path: '/goods/list', component: Goodslist },
  { path: '/photo/list', component: Image },
  { path: '/newslist', component: NewsList },
  { path: '/news/detail/:id', component: NewsDetail },
  { path: '/search', component: Search },
  { path: '/addgoods', component: AddGoods },
  { path: '/goods/detail/:id', component: GoodsDetail },
  { path: '/photo/Info/:id', component: ImgDetail }
]

const router = new VueRouter({
  routes
})

export default router
